<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
    <title>商城登陆</title>
    <meta name="keywords" content="关键词,5个左右,单个8汉字以内">
    <meta name="description" content="网站描述，字数尽量空制在80个汉字，160个字符以内！">
    <link rel="Bookmark" href="favicon.ico">

    <link href="/static/css/style.css" rel="stylesheet" type="text/css" />
    <link href="/static/css/reset.css" rel="stylesheet" type="text/css" />

</head>

<body class="bj">
<div class="header_fixed">
    <div class="container cf">
        <!--logo-->
        <div class="logohd">
            <div class="logo">
                <a href="/index">
                    <img src="img/logo.png" />
                    <h6>欢迎登录</h6>
                </a>
            </div>
        </div>
    </div>
</div>
<div class="logins">
    <div class="container">
        <div class="login_fr radius">
            <div class="login-hd">
                <h1>登录</h1>
                <a href="/register">免费注册</a>
            </div>
            <div class="login_con">
                <div class="login-input mb15">
                    <i class="iconfont">&#xe6e8;</i>
                    <input class="text" id="mobile" type="text" maxlength="50" name="mobile" value="" placeholder="手机号码">
                </div>
                <div class="login-input mb5">
                    <i class="iconfont">&#xe82b;</i>
                    <input class="text" id="password" type="password" maxlength="16" name="password" value="" placeholder="登录密码">
                </div>
                <div class="login-input">
                    <span id="regisErr" class="error"></span>
                    <a class="pass" href="forgetpassword.html">忘记密码?</a>
                </div>
                <button type="submit" onclick="return login();" class="loginBtn radius mt10">登&nbsp;&nbsp;录</button>
            </div>
        </div>
    </div>
    <div class="login_box">
        <div class="banner">
            <span style="background: url(img/login-banner.jpg) center no-repeat;"></span>
        </div>
    </div>
</div>



<!--底部-->
<div class="footer mt">
    <div class="container cf">
        <div class="top_links">
            <a href="#" target="_blank">公司简介</a>|
            <a href="#" target="_blank">企业文化</a>|
            <a href="#" target="_blank">加入我们</a>|
            <a href="#" target="_blank">联系我们</a>
        </div>
        <div class="copy">Copyright © 2011-2018 vvic.com <a href="" target="_blank">粤 ICP 备 12070150 号-2</a></div>
        <div class="secur">
            <a class="item" target="_blank" href="#">
                <img src="/static/img/footer_360.png" alt="">
            </a>
            <a class="item" target="_blank" href="#">
                <img src="/static/img/footer_sincerity.png" alt="">
            </a>
        </div>
    </div>
</div>

<!--返回顶部-->
<div class="ju-rbar">
    <div class="toolbar-tab">
        <a href="javascript:void(0)">
            <i class="iconfont">&#xe698;</i>
            <em class="tab-text">购物车</em>
        </a>
    </div>
    <div class="toolbar-tab">
        <a href="javascript:void(0)">
            <i class="iconfont">&#xe69f;</i>
            <em class="tab-text">客服</em>
        </a>
    </div>
    <div class="toolbar-tab">
        <a href="javascript:void(0)">
            <i class="iconfont">&#xe655;</i>
            <em class="tab-text">收藏</em>
        </a>
    </div>
    <div class="toolbar-tab">
        <a href="javascript:void(0)" id="top">
            <i class="iconfont">&#xe607;</i>
            <em class="tab-text">返回顶部</em>
        </a>
    </div>
</div>


<script type="text/javascript" src="/static/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/js/SuperSlide.js"></script>
<script type="text/javascript" src="/static/js/lazyload.js"></script>
<script type="text/javascript" src="/static/js/app.js"></script>
<script type="text/javascript">
    $(function() {
        //banner
        $(".slideBox").slide({
            titCell:".hd ul",
            mainCell:".bd ul",
            autoPage:true,
            autoPlay:true,
            effect:"fold",
            delayTime:2000
        });

        //图片延迟加载
        $("img.lazy").lazyload({
            effect: "fadeIn"
        });
    });
    function login() {
        var mobile, code, password;
        mobile = $("#mobile").val();
        code = $('#code').val();
        password = $('#password').val();
        var mobileRegx=/^((13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])+\d{8})$/;
        c=/^(0|[1-9]\d*)$/;
        if (mobile == null || mobile == '') {
            $('#regisErr').addClass('error').text('手机号不能为空');
            $('#mobile').focus();
            return false;
        } else if (!mobile.match(mobileRegx)) {
            $('#regisErr').addClass('error').text('手机号格式不正确!');
            $('#mobile').focus();
            return false;
//        } else if(code == null || code == ''){
//            $("#regisErr").addClass('error').text("验证码不能为空");
//            $('#code').focus();
//            return false;
//        }  else if(c.length < 4){
//            $("#regisErr").addClass('error').text("验证码错误");
//            $('#code').focus();
//            return false;
        } else if (password == null || password == '') {
            $('#regisErr').addClass('error').text('密码不能为空');
            $('#password').focus();
            return false;
        }

        $.ajax({
            url:"/gologin",
            data:{"mobile":mobile,"password":password},
            dataType:"json",
            success:function (data) {
                if(data){
                    window.location.href="/index";
                }else{
                    $('#regisErr').addClass('error').text('登陆失败');
                    $('#password').focus();
                }
            }
        })
    }
</script>
</body>

</html>

